import {createRouter, createWebHistory} from 'vue-router'

const routes = [
    {
        path: '/parking',
        name: 'Parking',
        component: () => import('../views/ParkingManagement.vue'),
        meta: {title: '进出管理'}
    },
    {
        path: '/statistics',  // 新增统计路由
        name: 'Statistics',
        component: () => import('../views/Statistics.vue'),
        meta: {title: '时段统计'}
    },
    {
        path: '/query',
        name: 'Query',
        component: () => import('../views/RecordQuery.vue'),
        meta: {title: '记录查询'}
    },
    {
        path: '/:pathMatch(.*)*',
        redirect: '/parking'
    },
    {
        path: '/heatmap',
        name: 'Heatmap',
        component: () => import('../views/Heatmap.vue'),
        meta: {title: '车流热力图'}
    },
    {
        path: '/revenue',
        name: 'RevenueAnalysis',
        component: () => import('../views/RevenueAnalysis.vue')
    }

]

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes
})

export default router